package com.xiaoyu.lanling.feature.moment.fragment.notice

import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import com.xiaoyu.lanling.R
import com.xiaoyu.lanling.feature.moment.controller.notice.LikeNoticeListController
import com.xiaoyu.lanling.feature.moment.data.notice.LikeNoticeListData
import com.xiaoyu.lanling.view.OnShowFragment
import kotlinx.android.synthetic.main.fragment_like_list.recyclerview
import kotlinx.android.synthetic.main.fragment_like_remind.*

class LikeNoticeFragment : OnShowFragment() {

    private lateinit var listController: LikeNoticeListController

    override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
        return inflater.inflate(R.layout.fragment_like_remind, container, false)
    }

    override fun onViewCreatedSafelyAfterAppFinishInit(view: View, savedInstanceState: Bundle?) {
        initData()
    }

    private fun initData() {
        activity?.let {
            listController = LikeNoticeListController.create(it, LikeNoticeListData(), swipe_refresh_layout, recyclerview)
            listController.loadFirstPageData()
        }
    }
}